package com.ww.springboot.boot.thread.study.base.other;

import java.util.function.IntConsumer;

/**
 * 描述：
 *
 * @author wanwei
 * @since 2021-11-05 15:15
 */
public class Run {
    public static void main(String[] args) throws InterruptedException {
        ZeroEvenOdd2 zeroEvenOdd2 = new ZeroEvenOdd2(10);

        IntConsumer printNumber = i -> System.out.println(i);

        new Thread(()->{
            try {
                zeroEvenOdd2.zero(printNumber);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }).start();

        new Thread(()->{
            try {
                zeroEvenOdd2.even(printNumber);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }).start();

        new Thread(()->{
            try {
                zeroEvenOdd2.odd(printNumber);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }).start();
    }
}
